#include <iostream>
#include <string>
using namespace std;

int main()
{
	string s("hello world");
	cout << s.size() << endl;

	for (size_t i = 0; i < s.size(); i++)
	{
		cout << s[i] << " ";
	}
	cout << endl;
	
	for (auto x : s)
	{
		cout << x << " ";
	}
	cout << endl;

	reverse(s.begin(), s.end());

	string::iterator it = s.begin();
	while (it != s.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;

	return 0;
}